/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 科技蓝紫渐变 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* 背景色 */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    /* 文字颜色 */
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    
    /* 边框和阴影 */
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-primary: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    /* 动画时间 */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 粒子背景效果 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.7; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 模式切换器 */
.mode-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--bg-glass);
    padding: 6px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.mode-btn.active {
    color: white;
    box-shadow: var(--shadow-glow);
}

.mode-btn.active::before {
    opacity: 1;
}

.mode-btn svg {
    width: 18px;
    height: 18px;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.mode-panel {
    display: none;
}

.mode-panel.active {
    display: contents;
}

/* 输入区域 */
.input-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-primary);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.url-input {
    margin-bottom: 20px;
}

.url-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.url-input input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
}

.url-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.prompt-section {
    margin-bottom: 20px;
}

.prompt-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.prompt-section textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    transition: all var(--transition-normal);
}

.prompt-section textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.negative-prompt {
    margin-bottom: 20px;
}

.negative-prompt label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.negative-prompt textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
    transition: all var(--transition-normal);
}

.negative-prompt textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 风格预设 */
.style-presets {
    margin-bottom: 20px;
}

.style-presets label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.preset-btn {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.preset-btn:hover {
    border-color: #667eea;
    color: var(--text-primary);
}

.preset-btn.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

/* 预览区域 */
.preview-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.preview-container {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-secondary);
    min-height: 200px;
    max-height: 600px;
    width: 100%;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}

.preview-placeholder svg {
    width: 48px;
    height: 48px;
    margin-bottom: 15px;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    display: block;
    margin: 0 auto;
}

/* 参数设置面板 */
.params-panel {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-primary);
    overflow: hidden;
}

.params-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.params-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-normal);
}

.toggle-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.toggle-btn svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-normal);
}

.toggle-btn.active svg {
    transform: rotate(180deg);
}

.params-content {
    padding: 0 25px 25px;
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition-normal);
}

.params-content.active {
    max-height: 500px;
}

.param-group {
    margin-bottom: 20px;
}

.param-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.param-group select,
.param-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-normal);
}

.param-group select:focus,
.param-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.param-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.param-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.param-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.random-btn {
    margin-left: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.random-btn:hover {
    border-color: #667eea;
    color: var(--text-primary);
}

/* 随机种子输入组 */
.seed-input-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.seed-input-group input {
    flex: 1;
    min-width: 0;
}

.seed-input-group .random-btn {
    flex-shrink: 0;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: stretch;
}

.generate-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-glow);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.generate-btn svg {
    width: 20px;
    height: 20px;
}

.reset-btn {
    padding: 16px 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
}

.reset-btn:hover {
    border-color: #667eea;
    color: var(--text-primary);
}

.reset-btn svg {
    width: 20px;
    height: 20px;
}

/* 进度条 */
.progress-container {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width var(--transition-normal);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 结果展示 */
.result-section {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-primary);
    overflow: hidden;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.result-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all var(--transition-normal);
}

.close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.result-content {
    padding: 25px;
}

.result-image {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.action-btn:hover {
    border-color: #667eea;
    background: var(--bg-tertiary);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* 通知组件 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-primary);
    transform: translateX(400px);
    transition: transform var(--transition-normal);
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-icon {
    width: 24px;
    height: 24px;
    color: #00ff88;
}

.notification-icon svg {
    width: 100%;
    height: 100%;
}

.notification-text {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .mode-switcher {
        flex-direction: column;
    }
    
    .mode-btn {
        padding: 15px 20px;
    }
    
    .input-section,
    .preview-section {
        padding: 20px;
    }
    
    .params-content {
        padding: 0 20px 20px;
    }
    
    .controls {
        flex-direction: row;
        gap: 10px;
    }
    
    .generate-btn {
        flex: 1;
        min-width: 0;
    }
    
    .reset-btn {
        flex-shrink: 0;
        padding: 12px 16px;
    }
    
    .seed-input-group {
        gap: 8px;
    }
    
    .seed-input-group .random-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .notification {
        right: 15px;
        left: 15px;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .input-section,
    .preview-section {
        padding: 15px;
    }
    
    .params-content {
        padding: 0 15px 15px;
    }
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gradient);
}

/* 图片信息显示样式 */
.image-info {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.image-info .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.image-info .info-item:last-child {
    margin-bottom: 0;
}

.image-info label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.image-info span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer 样式 */
.footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.footer-link {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.3s ease;
    text-underline-offset: 2px;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration-thickness: 2px;
    transform: translateY(-1px);
}

.copyright {
    font-size: 12px;
    color: var(--text-tertiary);
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .footer {
        margin-top: 20px;
        padding: 15px 0;
    }
    
    .footer-content {
        padding: 0 15px;
    }
    
    .footer-text {
        font-size: 13px;
    }
    
    .copyright {
        font-size: 11px;
    }
}
